home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
t
/
tar
/
Tar`Doc
< prev
Wrap
Text File
|
1993-08-26
|
16KB
|
435 lines
tar - tape archive, version 1.1o, written for the Archimedes by
Frank Lancaster, 7-Nov-1991
Bug reports and comments may be sent as e-mail to: fl@tools.uucp
Paper Mail: Frank Lancaster
Tools GmbH
Kessenicher Str. 108
W-5300 Bonn 1
Federal Republic of Germany
This programme is public domain. You may copy it freely, provided
you do not charge ANYTHING for its distribution.
Table of Contents
-----------------
1. Introduction
2. Installation
3. Usage
4. Normal Files As Archives
5. Hard Disc Backup
6. Compression
7. The List File
8. UNIX Compatibility
9. Raw disc dumping
10. History
1. Introduction
---------------
This version of tar is derived from the UNIX tar utility. Its main use
is as a hard disk backup programme. It also comes in very handy when
transferring files from or to UNIX. The name "tape archive" is misleading but
historical. On the Archimedes archives are ordinary files on any
file-system (adfs, scsi, dosfs, etc.). Multiple disc archives are supported,
now also as ordinary files. Disk archives in ADFS D/E/L or MS-DOS (double-
sided, 9 sectors) format dumped to raw disks are supported.
2. Installation
---------------
If you have clib version 3.66, you can use the tar_clib and compr_clib
versions of tar and compress.
Before using the programme set the system variable "tar$scrap" to the
name of a temporary scrap file which should only be used by tar,
for example "adfs::4.$.tmp.scrap". The leaf name must not be longer than
8 characters, another 2 ("-Z") are added if compression is used.
This file will only be used if compression is enabled.
If compression is used tar requires the compress programme (included in
this distribution), which handles compression and decompression. Normally
this should be accessable via the system variable Run$Path, but you can
customize the compression and decompression commands with the two system
variables tar$compress and tar$decompress (see below "compression").
The system variable tar$filetype is used as file type for tar files. If
it is not set, file type FFD (data) is used.
3. Usage
--------
The programme should be called from the command line interpreter as it
requires parameters.
tar [-]Commands[Options] ARCHIVE [LIST] [BLKS] [LEN] [-C DIR] file1 file2 ...
Commands:
c create a new archive
r append files to end of archive
t list the contents of an archive
x extract files from an archive
Options:
b BLKS blocking factor BLKS (block size = BLKS x 512 bytes)
e LENGTH maximum length of extension to use in UNIX file names
f ARCHIVE read/write archive from file ARCHIVE (mandatory)
i ignore checksum errors and blocks of zeros (normally EOF)
l [LIST] read list of files from file LIST or !tarlist as default
m don't extract file modified time
p convert '!' in RISC OS names to '.' in UNIX names
s swap extension in filename
v verbosely list what files we process
w ask for confirmation
z run files through compress
B reblock as we read
C DIR change to directory DIR
E '.' in UNIX names will be converted to '_'
F format disk in drive 0 (multiple volumes & E-format only)
M use multiple volume archiving
O do not prompt for confimation when formating or overwriting disks
Q quit immediately if error occurs, do not prompt for action
S swap extensions in whole path
T file types appended to names as with RISC-OS NFS
U UNIX archive (no Archimedes extensions)
Z convert UNIX '.Z' to '-Z' when extracting
You must specify an archive file on the command line with the 'f' option.
The path names of the archived files are stored as specified on
the command line. Using the 'v' (verbose) option will list the path names
stored as the archive is created. Normally you shouldn't specify the absolute
path names, as you may want to extract the files to an other directory.
4. Normal Files As Archives
---------------------------
Here the use of tar is identical to the UNIX usage. The file name of an
archive must always be supplied with the 'f' option. To create an archive
use the 'c' option:
tar cvf myarc file1 file2 file3
This will create an archive 'myarc' in the current directory which contains
the files 'file1', 'file2' and 'file3'. I always recommend using the 'v'
option with every command, this gives more information on what is happening.
You can use path names with the archives and files specified:
tar cvf adfs::4.tmp.myarc adfs::5.file1 adfs::4.src.file2
To list the contents of an archive use the 't' command:
tar tvf myarc
To extract files from an archive use the 'x' command:
tar xvf myarc
This command will extract all files in the archive. If you only want certain
files, you can specify them after the archive name:
tar xvf myarc file1 file2
5. Hard disc backup
-------------------
This actually isn't very different from normal archiving. The main difference
is that archive files are of course written to floppy discs and that they
can be split across several discs. The command:
tar cvMf :0.backup :4.*
will backup all files on the hard disk :4 onto floppy disk :0 in the
file 'backup'. If the archive requires more than one floppy disc, you will
be prompted for more discs, which will contain further files also called
'backup'. They contain a header which supplies identification of the disc
number so that 'tar' will be able to determine the disc sequence when
extracting.
It would be better to go to the root directory of the hard disc and to use
the following command:
tar cvMf :0.backup *
This will store the path names without the drive name, so you could extract
them onto a different hard disk.
The command:
tar tvf :0.backup
will list the contents of an archive on floppy disc :0. If the archive was
split across several discs, tar will prompt for further discs when finished
listing one.
The command:
tar xvf :0.backup
will extract all files on floppy disc :0 in the file 'backup'. If the file,
which is being extracted, already exists, tar will overwrite it without any
warning.
6. Compression
--------------
With the 'z' option files can be compressed before being written to an archive.
For compression the standard UNIX utility compress is used, also supplied with
the tar programme. The system variable tar$scrap is used for temporary storage.
If you are backing up a complete hard disc and have enough memory you should
use a RAM disc for the scrap file, and the compress programme should also be
copied onto the RAM disc. You can use different programmes for
compression and decompression if you set the tar$compress and tar$decompress
system variables. The default settings are:
tar$compress compress < %1 > %2
tar$decompress compress -d < %1 > %2
Most compression programmes add a suffix to the compressed file. The UNIX
compress programme adds '-Z'. If a compression programme that you want to use,
uses a different suffix, you can set the system variable 'tar$compress$extension'.
When writing a file 'TresImp' to an archive the compress command will expand to:
compress < TresImp > Scrap-Z
The %1 parameter is substituted with the file name and %2 is substituted with
the scrap file name.
The decompress command, when extracting the file, will expand to:
compress -d < Scrap-Z > TresImp
So if you have a compression programme 'squash' and a decompression programme
'expand', which take two parameters and don't use I/O redirection, set the
variables to:
tar$compress squash %1 %2
tar$decompress expand %1 %2
You can also specify absolute paths in these variables, e.g. when the
compression programme is on the RAM disc:
tar$compress ram:$.compress < %1 > %2
tar$decompress ram:$.compress -d < %1 > %2
Compressed files are automatically detected when extracting. A verbose listing
of the archive also shows the comp